set(VERSION_MAJOR 1)
set(VERSION_MINOR 0)
set(VERSION_MICRO 0)
set(UKUI_SNI_HOST_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO})
include_directories(../common)
find_package(dbusmenu-qt5 REQUIRED)
set(ukui-sni-host_LIB_SRCS
        status-notifier-host.cpp
        ../common/dbus-types.cpp
        status-notifier-item.cpp
        status-notifier-item-private.h)
set(HEADERS
        status-notifier-host.h
        status-notifier-item.h
        )
qt_add_dbus_interface(ukui-sni-host_LIB_SRCS ../dbus/org.kde.StatusNotifierWatcher.xml statusnotifierwatcher_interface)
qt_add_dbus_interface(ukui-sni-host_LIB_SRCS ../dbus/org.freedesktop.DBus.Properties.xml dbusproperties)
set(statusnotifieritem_xml ../dbus/org.kde.StatusNotifierItem.xml)
set_source_files_properties(${statusnotifieritem_xml} PROPERTIES
        NO_NAMESPACE false
        INCLUDE "../common/dbus-types.h"
        CLASSNAME OrgKdeStatusNotifierItem
        )
qt_add_dbus_interface(ukui-sni-host_LIB_SRCS ${statusnotifieritem_xml} statusnotifieritem_interface)

add_library(ukui-sni-host SHARED ${ukui-sni-host_LIB_SRCS})
target_include_directories(ukui-sni-host PUBLIC ../common)
target_link_libraries(ukui-sni-host
        PRIVATE
        Qt${QT_VERSION_MAJOR}::Core
        Qt${QT_VERSION_MAJOR}::DBus
        Qt${QT_VERSION_MAJOR}::Gui
        Qt${QT_VERSION_MAJOR}::Widgets
        Qt${QT_VERSION_MAJOR}::X11Extras
        dbusmenu-qt5
        )
install(TARGETS ukui-sni-host LIBRARY DESTINATION  "/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
